package java_test.newfeatures;

import java.util.Comparator;

public class LambdaTest {
    public static void main(String[] args) {
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                System.out.println("我爱北京");
            }
        };
        r1.run();

        Runnable r2 = () -> System.out.println("胡宇婷");
        r2.run();

        Comparator<Integer> com1 = new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return Integer.compare(o1, o2);
            }
        };
        Comparator<Integer> com2 = (o1, o2) -> Integer.compare(o1, o2);
    }
}
